from docx import Document
NAME = '<name>'
PHONE = 'PHONE'
SEAT = 'SEAT'


def invite(name, phone, seat):
    doc = Document('template2.docx')
    for p in doc.paragraphs:
        for r in p.runs:
            if NAME in r.text:
                r.text = r.text.replace(NAME, name)
            if PHONE in r.text:
                r.text = r.text.replace(PHONE, phone)
            if SEAT in r.text:
                r.text = r.text.replace(SEAT, seat)
    doc.save(f'{name}-{phone}.docx')


invite('张三', '18812345678', 'D3B20')